<include file="template:style"/>
<form role="form" id="searchForm" action="{:U('Reportorder/index')}" method='post' class="form-horizontal">
    <div class="form-group">
        <if condition="$account.role == 1">
            <include file="template:select" results="params" name="companyid" list="companyList" label="分公司" attr=''/>
        </if>
        <include file="template:search" results="params" name="sourceAccount" label="下单代理" attr='data-rule="length(~20)" maxlength="20"'/>
		<include file="template:search" results="params" name="sn" label="单号" attr='data-rule="length(~20)" maxlength="20"'/>
        <include file="template:search" results="params" name="toagenAccount" label="上级代理" attr='data-rule="length(~20)" maxlength="20"'/>
		<include file="template:select" results="params" name="status" label="状态" list="reportStatus" attr=''/>
		<include file="template:range" results="params" name="total" label="金额" attr='data-rule="length(~20)" maxlength="20"'/>
		<include file="template:time" results="params" name="createtimeStart" label="创建时间开始" attr='data-rule="length(~19)" maxlength="19"'/>
        <include file="template:time" results="params" name="createtimeEnd" label="创建时间结束" attr='data-rule="length(~19)" maxlength="19"'/>
		<include file="template:time" results="params" name="updatetimeStart" label="更新时间开始" attr='data-rule="length(~19)" maxlength="19"'/>
        <include file="template:time" results="params" name="updatetimeEnd" label="更新时间结束" attr='data-rule="length(~19)" maxlength="19"'/>
		<include file="template:select" results="params" name="pageSize" list="page" label="每页条数" />
        <div class="col-xs-12">
			<div class="col-xs-4 col-sm-3 col-md-2 col-lg-1 pull-left">
                <div class="row">
                </div>
            </div>
			<div class="col-xs-4 col-sm-3 col-md-2 col-lg-1">
                <div class="row">
					<span>总金额：{$sum.totalsum}</span>
				</div>
            </div>
            <div class="col-xs-4 col-sm-3 col-md-2 col-lg-1 pull-right">
                <div class="row">
                    <include file="template:searchBtn"/>
                    <include file="template:reloadBtn"/>
                </div>
            </div>
        </div>
    </div>
</form>
<div class="table-responsive">
    <table class="table table-bordered">
        <thead>
        <tr>
            <th nowrap="nowrap">ID</th>
            <if condition="$account.role == 1">
                <th nowrap="nowrap">所属分公司</th>
            </if>
            <th nowrap="nowrap">下单代理账号</th>
            <th nowrap="nowrap">下单代理名称</th>
            <th nowrap="nowrap">单号</th>
            <th nowrap="nowrap">上级代理账号</th>
            <th nowrap="nowrap">上级代理名称</th>
            <th nowrap="nowrap">状态</th>
            <th nowrap="nowrap">总金额</th>
            <th nowrap="nowrap">创建时间</th>
            <th nowrap="nowrap">更新时间</th>
            <th nowrap="nowrap">操作</th>
        </tr>
        </thead>
        <tbody>
        <volist name="list" id="vo">
            <tr>
				<td nowrap="nowrap">{$vo.id}</td>
                <if condition="$account.role == 1">
                    <td nowrap="nowrap">{$vo.companyname}</td>
                </if>
				<td nowrap="nowrap">{$vo.sourceaccount}</td>
                <td nowrap="nowrap">{$vo.sourcename}</td>
				<td nowrap="nowrap">{$vo.sn}</td>
				<td nowrap="nowrap">{$vo.toagenaccount}</td>
                <td nowrap="nowrap">{$vo.toagenname}</td>
				<td nowrap="nowrap">{$vo.status|getDropdownList="reportStatus",###}</td>
				<td nowrap="nowrap">{$vo.total}</td>
				<td nowrap="nowrap">{$vo.createtime}</td>
				<td nowrap="nowrap">{$vo.updatetime}</td>
                <td nowrap="nowrap">
                    <!--详情-->
                    <i class="fa fa-file-text-o qg-op-btn qg-tooltip" data-toggle="tooltip" data-placement="top" title="查看详细" onclick="modal('{:U(\'Reportorder/info\', array(\'id\'=>$vo[\'id\']))}', '详情')"></i>
                    <!-- 审核人是1 -->
                    <eq name="vo.status" value="1">
                        <eq name="vo.toagenid" value="1">
                            <!--批准-->
                            <i class="fa fa-check qg-tooltip qg-op-btn" data-toggle="tooltip" data-placement="top" title="批准" onclick="confirmUpdate('{:U(\'Reportorder/confirm\')}','{$vo.id}','确定要批准吗？')"></i>
                        </eq>
                        <!--驳回-->
                        <i class="fa fa-times-circle qg-tooltip qg-op-btn" data-toggle="tooltip" data-placement="top" title="驳回" onclick="confirmUpdate('{:U(\'Reportorder/reject\')}','{$vo.id}','确定要驳回吗？')"></i>
                    </eq>
                </td>
            </tr>
        </volist>
        </tbody>
    </table>
</div>
{$page}